package com.originalpoint.origin_server.controller;

import com.originalpoint.origin_server.pojo.Merchat;
import com.originalpoint.origin_server.service.Impl.MerchatInfoServiceImpl;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@CrossOrigin
@RestController
@RequestMapping("/MerchatInfo")
public class MerchatInfoController {
    @Autowired
    MerchatInfoServiceImpl merchatInfoService;

    @ApiOperation(value  = "根据id查询商家表")
    @PostMapping("/select")
    public Map findMerchatInfo(Integer merId){
        Merchat merchat= merchatInfoService.findMerchatInfo(merId);
        Map map = new HashMap();
        map.put(0,merchat);
        map.put("msg","操作成功");
        return map;
    }
    @ApiOperation(value  = "根据id更新商家信息")
    @PostMapping("/update")
    public void updateMerchatInfo(@RequestBody Merchat merchat){
        merchatInfoService.updateMerchatInfo(merchat);
    }
}
